<?php
$server="localhost";
$name="root";
$pwd="123456";
$db="sinip";

$con=mysqli_connect($server,$name,$pwd,$db);

$name=$_POST['name'];
$age=$_POST['age'];
$sex=$_POST['sex'];
$ads=$_POST['ads'];

if ($con){
    $sql="insert into sinipla(name,age,sex,ads) values('$name','$age','$sex','$ads')";
    $run=mysqli_query($con,$sql);
    if($run){
        echo "数据表数据添加成功";
    }else{
        echo "已连接数据成功，但未能添加数据".mysqli_error($con);
    }
    }else{
    echo "未连接数据库，错误内容：" .mysqli_connect_error();
}
